import {Component, OnInit, Input, Output, EventEmitter} from '@angular/core';

@Component({
  selector: 'app-task-item',
  templateUrl: './task-item.component.html',
  styleUrls: ['./task-item.component.scss']
})
export class TaskItemComponent implements OnInit {
  @Input() public item;
  @Input() public avatar;
  @Output() public taskClick = new EventEmitter();

  constructor() {

  }

  ngOnInit() {
    this.avatar = this.item.owner ? this.item.owner.avatar : 'unassigned';
    console.log(this.avatar);
  }

  onItemClick() {
    this.taskClick.emit();
  }

  onClickCheckbox(ev: Event) {
    ev.stopPropagation();
  }


}
